<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>页面设置</TITLE>
<SCRIPT language=javaScript src="/webprint/billprint/public.js"></SCRIPT>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
	var BillName=window.dialogArguments[0]
	var userData=window.dialogArguments[1]

	
	//单据的缺省宽度高度
	var repWidth=210	
	var repHeight=297
	var printCopys=3		//每张纸上打印几个信封
	var topwindage=0	//上边距的偏移量
	var leftwindage=0	//左边距的偏移量
	var printformat="套打"//单据打印的样式,可选择套打、只打单据样式、全部打印。
	var offsetAdjust1=0
	
	var bOkExit=false
function designOK_onclick() {
	if (check()==false){
		return
	}
	var DesignReturn=new Array()
		DesignReturn[0]=TopWarp.value
		DesignReturn[1]=LeftWarp.value 
		DesignReturn[2]=PrintFormat.options .item(PrintFormat.selectedIndex).value
		DesignReturn[3]=pageWidth.value 
		DesignReturn[4]=pageHeight.value 
		DesignReturn[5]=PrintCopys.options .item(PrintCopys.selectedIndex).text
		DesignReturn[6]=offsetAdjust.value 

	var strPage="<topwindage>"+DesignReturn[0]+"</topwindage>"+"<leftwindage>"+DesignReturn[1]+"</leftwindage>"+"<PrintFormat>"+DesignReturn[2]+"</PrintFormat>"
		+"<repWidth>"+DesignReturn[3]+"</repWidth>"
		+"<repHeight>"+DesignReturn[4]+"</repHeight>"
		+"<PrintCopys>"+DesignReturn[5]+"</PrintCopys>"
		+"<offsetAdjust>"+DesignReturn[6]+"</offsetAdjust>"
	
	SaveUserData("billprint",BillName,strPage)
	bOkExit=true
	window.returnValue=bOkExit
	self.close ()
}
function check(){
	if (TopWarp.value==""){
		TopWarp.value=0
	}
	if (isNaN(TopWarp.value)==true){
		alert("请输入数字！")
		TopWarp.value ="0"
		TopWarp.focus ()
		return false			
	}				
	
	if (LeftWarp.value ==""){
		LeftWarp.value=0
	}		
	if (isNaN(LeftWarp.value )==true){
		alert("请输入数字！")
		LeftWarp.value ="0"
		LeftWarp.focus ()
		return false			
	}				
	if (pageWidth.value ==""){
		pageWidth.value=100
	}		
	if (isNaN(pageWidth.value )==true){
		alert("请输入数字！")
		pageWidth.value =100
		pageWidth.focus ()
		return false			
	}				
	if (pageHeight.value ==""){
		pageHeight.value=100
	}		
	if (isNaN(pageHeight.value )==true){
		alert("请输入数字！")
		pageHeight.value =100
		pageHeight.focus ()
		return false			
	}				
	if (offsetAdjust.value ==""){
		offsetAdjust.value=0
	}		
	if (isNaN(offsetAdjust.value )==true){
		alert("请输入数字！")
		offsetAdjust.value ="0"
		offsetAdjust.focus ()
		return false			
	}				
	

}

function window_onload() {
	//从缓存中取出页面设置信息
	var setformat=LoadUserData("billprint",BillName)
	if (setformat!=""){
		var oXML1=new ActiveXObject("Microsoft.XMLDOM")
		oXML1.async="false"
		oXML1.loadXML("<root>"+setformat+"</root>")
		topwindage=parseFloat(oXML1.documentElement.childNodes.item(0).text)
		leftwindage=parseFloat(oXML1.documentElement.childNodes.item(1).text)
		printformat=oXML1.documentElement.childNodes.item(2).text
		repWidth=parseFloat(oXML1.documentElement.childNodes.item(3).text)
		repHeight=parseFloat(oXML1.documentElement.childNodes.item(4).text)
		printCopys=parseInt(oXML1.documentElement.childNodes.item(5).text)
		offsetAdjust1=parseFloat(oXML1.documentElement.childNodes.item(6).text)
	}
	//-------------	
	TopWarp.value = topwindage
	LeftWarp .value = leftwindage
	pageWidth.value = repWidth
	pageHeight.value = repHeight
	PrintCopys.selectedIndex  = printCopys-1
	for (var i=0;i<=2;i++){
		if (PrintFormat.options(i) .value==printformat)
			PrintFormat.options(i).selected="true"
	}
	
	offsetAdjust.value=offsetAdjust1
}

function designCancel_onclick() {
	self.close ()
}

function window_onbeforeunload() {
	window.returnValue=bOkExit
}

//-->
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()" bgcolor="#ded5cf" onbeforeunload="return window_onbeforeunload()">

<fieldset style="HEIGHT: 135px; LEFT: 22px; POSITION: absolute; TOP: 20px; WIDTH: 263px">
<legend style="FONT-SIZE: 14px" >设置</legend>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="75%" style="FONT-SIZE: 13px; HEIGHT: 41px; LEFT: 17px; POSITION: absolute; TOP: 24px; WIDTH: 219px">  
  <TR>
    <TD align=right>上偏移量：</TD>
    <TD align=left style="WIDTH: 102px"><INPUT id=TopWarp  
      style="HEIGHT: 20px; WIDTH: 102px"></TD>
    <TD>毫米</TD></TR>
  <TR>
    <TD align=right>左偏移量：</TD>
    <TD align=left><INPUT id=LeftWarp 
      style="HEIGHT: 20px; WIDTH: 102px"></TD>
    <TD>毫米</TD></TR>
  <TR>
    <TD align=right>宽度：</TD>
    <TD align=left style="WIDTH: 102px"><INPUT id=pageWidth 
      style="HEIGHT: 20px; WIDTH: 102px"></TD>
    <TD>毫米</TD></TR>
  <TR>
    <TD align=right>高度：</TD>
    <TD align=left style="WIDTH: 102px"><INPUT id=pageHeight
      style="HEIGHT: 20px; WIDTH: 102px"></TD>
    <TD>毫米</TD></TR>
  <TR>
    <TD align=right>页距调整：</TD>
    <TD align=left><INPUT id=offsetAdjust 
      style="HEIGHT: 20px; WIDTH: 102px"></TD>
    <TD>毫米</TD></TR>


</TABLE>
</fieldset>
<fieldset style="HEIGHT: 82px; LEFT: 22px; POSITION: absolute; TOP: 160px; WIDTH: 264px">
<legend style="FONT-SIZE: 14px; HEIGHT: 16px; WIDTH: 55px">打印方式设置</legend>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="75%" style="FONT-SIZE: 13px; HEIGHT: 30px; LEFT: 11px; POSITION: absolute; TOP: 21px; WIDTH: 199px">
  <TR>
    <TD align=right>打印格式：</TD>
    <TD><SELECT id=PrintFormat style="HEIGHT: 22px; WIDTH: 85px"> 
    <OPTION selected value="套打">套打</OPTION>
    <OPTION value="打印样式">打印样式</OPTION>
    <OPTION value="全部打印">全部打印</OPTION>
    </SELECT></TD></TR>
  <TR>
    <TD align=right>打印份数：</TD>
    <TD><SELECT id=PrintCopys style="HEIGHT: 22px; WIDTH: 85px"> 
    <OPTION >1</OPTION>
    <OPTION >2</OPTION>
    <OPTION selected >3</OPTION>
    <OPTION >4</OPTION>
    <OPTION >5</OPTION>
    <OPTION >6</OPTION>
    <OPTION >7</OPTION>
    <OPTION >8</OPTION>
    <OPTION >9</OPTION>
    </SELECT></TD></TR>
</TABLE>
</fieldset>
<TABLE border=0 cellPadding=1 cellSpacing=1 width="75%" id=TABLE1 style="FONT-SIZE: 13px; HEIGHT: 32px; LEFT: 91px; POSITION: absolute; TOP: 258px; WIDTH: 113px">
  <TR>
    <TD></TD>
    <TD align=middle><INPUT id=designOK language=javascript name=button1 onclick="return designOK_onclick()" type=button value="确  定"></TD>
    <TD align=middle><INPUT id=designCancel name=button2 type=button value="取  消" LANGUAGE=javascript onclick="return designCancel_onclick()"></TD>
    <TD></TD></TR></TABLE>

</BODY>
</HTML>
